package test.h0816;

import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;
import java.util.function.Consumer;

/**
  * @description 找朋友
  * @author 不知名帅哥
  * @date 2024/8/16 16:01
  * @version 1.0
*/
public class Main4 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i]=sc.nextInt();
        }
        int start=0;
        int end=1;
        int[] ans = new int[n];
        while (start<n){
            int cur=arr[start];
            while (end<n){
                if (arr[end]>cur){
                    ans[start]=end;
                    break;
                }
                end++;
            }
            start++;
            end=start+1;
        }
        StringJoiner joiner=new StringJoiner(" ");
        for (int a : ans) {
            joiner.add(a+"");
        }
        System.out.println(joiner);
    }
}
